﻿using System;
using System.IO;

namespace ConcatenateFiles
{
    class ConcatenateFiles
    {
        static void Concatinate(StreamWriter writer, string path)
        {
            using (StreamReader reader = new StreamReader(path))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    writer.WriteLine(line);
                }
            }
        }
        static void Main()
        {
            string[] files = { "..\\..\\FirstFile.txt", "..\\..\\SecondFile.txt" };
            string newFilePath = @"..\..\Result.txt";

            using (StreamWriter writer = new StreamWriter(newFilePath))
            {
                foreach (string path in files)
                {
                    Concatinate(writer, path);
                }
            }
        }
    }
}
